// pages/resume/assessment/assessment.js
Page({
  data: {
    assessment:{}
  },
  onLoad: function (options) {
    var that=this;
    wx.getStorage({
      key:'assessment',
      success:function(res){
        that.setData({
          assessment:res.data,
          
        })
      }
    })
  },
  formSubmit:function(e){
    console.log(e.detail.value)
    var that=this;
    that.setData({
      assessment:e.detail.value
    });
    wx.setStorage({
      key:'assessment',
      data:that.data.assessment,
      success:function(res){
      }
    })
    var pages = getCurrentPages();
    var currPage = pages[pages.length - 1];
    var prevPage = pages[pages.length - 2];
    console.log(that.data.assessment)
    if(that.data.assessment.data){
      wx.showModal({
        title: '提示',
        content: '信息更新成功，请继续完善简历',
        showCancel: false,
        success: function (res) {
          wx.navigateBack()
        }
      });
      prevPage.setData({
        assessment: currPage.data.assessment,
        assessmentShow: false,
      });
    }else{
      wx.showModal({
        title: '提示',
        content: '没有可用来保存的信息',
        showCancel: false,
        success: function (res) {
        }
      });
    }
  }
})